package com.tencreat.mall.controller.admin;

import com.tencreat.common.annotation.Log;
import com.tencreat.common.enums.BusinessType;
import com.tencreat.service.account.IMallUserService;
import com.tencreat.common.core.HttpResult;
import com.tencreat.domain.account.dto.MallMessageDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags="专题api")
@RestController
@RequestMapping("/mall/message")
public class AdminMessageController {
    @Autowired
    private IMallUserService mallUserService;


    /**
     * 推送消息
     */
    @ApiOperation(value="推送消息")
    @PostMapping("/push")
    @Log(title = "商城管理>消息中心", businessType = BusinessType.DELETE)
    public HttpResult<Boolean> list(@RequestBody MallMessageDTO mallMessagePO) {
        return mallUserService.pushMessage(mallMessagePO);
    }
}
